<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>返回当前 FTP 连接的各种不同的选项设置</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.ftp-get-option" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">ftp_get_option</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">ftp_get_option</span> &mdash; <span class="dc-title">返回当前 FTP 连接的各种不同的选项设置</span></p>

   </div>
   <div class="refsect1 unknown-seealsp" id="refsect1-function.ftp-get-option-unknown-seealsp">
    <h3 class="title">说明</h3>
    <div class="methodsynopsis dc-description">
     <span class="methodname"><strong>ftp_get_option</strong></span>
      ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$ftp_stream</code></span>
     , <span class="methodparam"><span class="type">int</span> <code class="parameter">$option</code></span>
     ) : <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span></div>

    <p class="para rdfs-comment">
     如果成功则返回选项的值，否则，如果给定的参数 <code class="parameter">option</code>
     选项如果不被支持则返回 <strong><code>FALSE</code></strong> 同时会提示一条错误信息。
    </p>
    <p class="para">
     此函数会返回连接句柄为 <code class="parameter">ftp_stream</code>，指定键值 <code class="parameter">option</code>
     的值，截止到目前，以下选项被支持:
     <table class="doctable table">
      <caption><strong>支持 FTP 超时选项</strong></caption>
      
       <tbody class="tbody">
        <tr>
         <td>FTP_TIMEOUT_SEC</td>
         <td>返回当前设定的网络操作的超时时间。</td>
        </tr>

       </tbody>
      
     </table>

    </p>
    <div class="example" id="example-5313">
     <p><strong>Example #1 <span class="function"><strong>ftp_get_option()</strong></span> 实例 </strong></p>
     <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Get&nbsp;the&nbsp;timeout&nbsp;of&nbsp;the&nbsp;given&nbsp;FTP&nbsp;stream<br /></span><span style="color: #0000BB">$timeout&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ftp_get_option</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn_id</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">FTP_TIMEOUT_SEC</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
     </div>

    </div>
    <p class="para">
     参见 <span class="function"><a href="ftp_set_option.html" class="function">ftp_set_option()</a></span>。
    </p>
   </div>

  </div></div></div></body></html>